package com.wing.product.model.response;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.product.model.entity.ProductSpec;

/**
 * 产品类型规格VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ProductSpecVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 名称
     */
    private String name;

    /**
     * 产品分类
     */
    private Long productType;

    /**
     * 显示样式
     */
    private ProductSpec.Style style;

    /**
    * 显示样式描述
    */
    @TableField(exist = false)
    private String styleDesc;

    public String getStyleDesc() {
        return style.getDesc();
    }

    /**
     * 排序
     */
    private Integer sortNumber;
    /**
     * 规格头
     */
    private String specHead;

    /**
     * 规格码
     */
    private ProductSpec.SpecCode specCode;

    @TableField(exist = false)
    private String specCodeDesc;

    public String getSpecCodeDesc() {
        return specCode.getDesc();
    }

    /**
     * 规格补位位置
     */
    private ProductSpec.SpecLocation specLocation;
    @TableField(exist = false)
    private String specLocationDesc;

    public String getSpecLocationDesc() {
        return specLocation.getDesc();
    }
    /**
     * 规格参数排序
     */
    private Integer specSort;

    private ProductSpec.DataSourceType dataSourceType;

    private Long idPlatform;

    @TableField(exist = false)
    private String dataSourceTypeDesc;

    public String getDataSourceTypeDesc(){
        if (dataSourceType!=null){
            return dataSourceType.getDesc();
        }
        return "";
    }

}
